package com.saturday.common.constants;

public class CommonConsts {

    public static final Byte IS_ENABLE = 1;

    public static final Byte IS_NOT_ENABLE = 0;

    public static final Byte DELETE_YES = 1;

    public static final Byte DELETE_NO = 0;

    /**
     * 成功
     */
    public static final Byte SUCCESS = 1;

    /**
     * 失败
     */
    public static final Byte FAIL = 0;

    /**
     * 全局追踪号
     */
    public static final String TRACE_ID_LOG = "traceId";

    /**
     * 用户上下文信息
     */
    public static final String USER_CONTEXT = "userContext";

    public static final String USER_SESSIONID = "sessionId";

    public static final String HTTP_HEADER_ACCESS_TOKEN = "access-token";

    /**
     * 数据权限前缀
     */
    public static final String DATA_AUTH_RULE_PREFIX = "data:auth:";

    /**
     * feign调用头信息标识
     */
    public static final String FEIGN_CLIENT_KEY = "feign-client";

    /**
     * feign异常传递响应头信息错误码key
     */
    public static final String FEIGN_RESPONSE_HEADER_ERROR_CODE_KEY = "error-code";

    /**
     * feign异常传递响应头信息错误信息key
     */
    public static final String FEIGN_RESPONSE_HEADER_ERROR_MESSAGE_KEY = "error-message";

    /**
     * UTF-8 字符集
     */
    public static final String UTF8 = "UTF-8";

    /**
     * GBK 字符集
     */
    public static final String GBK = "GBK";

    /**
     * RMI 远程方法调用
     */
    public static final String LOOKUP_RMI = "rmi:";

    /**
     * LDAP 远程方法调用
     */
    public static final String LOOKUP_LDAP = "ldap:";

    /**
     * LDAPS 远程方法调用
     */
    public static final String LOOKUP_LDAPS = "ldaps:";

    /**
     * http请求
     */
    public static final String HTTP = "http://";

    /**
     * https请求
     */
    public static final String HTTPS = "https://";


    /**
     * 登录成功
     */
    public static final String LOGIN_SUCCESS = "Success";

    /**
     * 注销
     */
    public static final String LOGOUT = "Logout";

    /**
     * 注册
     */
    public static final String REGISTER = "Register";

    /**
     * 登录失败
     */
    public static final String LOGIN_FAIL = "Error";

    /**
     * 当前记录起始索引
     */
    public static final String PAGE_NUM = "pageNum";

    /**
     * 每页显示记录数
     */
    public static final String PAGE_SIZE = "pageSize";

    /**
     * 排序列
     */
    public static final String ORDER_BY_COLUMN = "orderByColumn";

    /**
     * 排序的方向 "desc" 或者 "asc".
     */
    public static final String IS_ASC = "isAsc";

    /**
     * 验证码 redis key
     */
    public static final String CAPTCHA_CODE_KEY = "captcha_codes:";

    /**
     * 验证码有效期（分钟）
     */
    public static final long CAPTCHA_EXPIRATION = 2;


    /**
     * 参数管理 cache key
     */
    public static final String SYS_CONFIG_KEY = "sys_config:";

    /**
     * 字典管理 cache key
     */
    public static final String SYS_DICT_KEY = "sys_dict:";

    /**
     * 资源映射路径 前缀
     */
    public static final String RESOURCE_PREFIX = "/profile";

    /**
     * tokenName
     */
    public static final String TOKEN_NAME = "access-token";

    /**
     * 令牌自定义标识
     */
    public static final String AUTHENTICATION = "Authorization";

    /**
     * 令牌前缀
     */
    public static final String PREFIX = "Bearer ";

    /**
     * 令牌前缀
     */
    public static final String CURRENT_USER_HEADER = "current-user";

    public static final String IO_TMPDIR_PROPERTY = "java.io.tmpdir";
    public static final String USER_TMP_DIR = System.getProperty(IO_TMPDIR_PROPERTY);

    public static final String APPLICATION_JSON = "application/json";

    public static final String APPLICATION_JSON_UTF8 = "application/json; charset=utf-8";
}
